package routers

import (
	"github.com/gin-contrib/cors"
	"github.com/gin-gonic/gin"
	"role/handlers"
)

func Init() *gin.Engine {
	r := gin.Default()

	r.Use(cors.Default())
	r.Static("static", "./static")
	r.POST("/user/add", handlers.Add)
	r.GET("/user/list", handlers.List)
	r.POST("/role/add", handlers.RoleAdd)
	r.POST("/role/list", handlers.RoleList)
	r.GET("/users/list", handlers.UsersList)
	return r

}
